package cn.yuan.xiaoyu.testmodule.adapter;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.yuan.xiaoyu.R;

/**
 * Created by yukuoyuan on 2017/5/24.
 */

public class TestYreAdapter extends RecyclerView.Adapter<TestYreAdapter.MyHolder> {
    private Context context;
    private List<String> list01;
    private TestRecycleviewAdapter testRecycleviewAdapter01;

    public TestYreAdapter(Context context, List<String> list01) {
        this.context = context;
        this.list01 = list01;
    }

    @Override
    public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = View.inflate(parent.getContext(), R.layout.item_testyrecyclerview, null);
        return new MyHolder(view);
    }

    @Override
    public void onBindViewHolder(MyHolder holder, int position) {
        holder.rcvTest01.setLayoutManager(new LinearLayoutManager(context));
//        if (testRecycleviewAdapter01 == null) {
//            testRecycleviewAdapter01 = new TestRecycleviewAdapter(this,list01);
//            holder.rcvTest01.setAdapter(testRecycleviewAdapter01);
//        }
//        testRecycleviewAdapter01.notifyDataSetChanged();
    }

    @Override
    public int getItemCount() {
        return 1;
    }

    class MyHolder extends RecyclerView.ViewHolder {
        @Bind(R.id.rcv_test_01)
        RecyclerView rcvTest01;
        @Bind(R.id.rcv_test_02)
        RecyclerView rcvTest02;

        public MyHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);

        }
    }
}
